﻿using Appliaction.Dto.Inv;
using Domain.Entitys.Inv;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Appliaction.IAppServices.Inv
{
    public interface IInv_Trfservices
    {
        /// <summary>
        /// 仓库调拨列表分页查询
        /// </summary>
        /// <param name="trf_code"></param>
        /// <param name="trf_type"></param>
        /// <param name="currentPage"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        List<Trf_selectDto> Inv_trf_selectFY(string trf_code, string trf_type, int currentPage, int pageSize, string proName);

        /// <summary>
        /// 仓库调拨列表查询
        /// </summary>
        /// <param name="trf_code"></param>
        /// <param name="trf_type"></param>
        /// <returns></returns>
        Task<int> Inv_trf_selectCount(string trf_code, string trf_type, string proName);


        /// <summary>
        /// 根据编号查询仓库调拨
        /// </summary>
        /// <param name="trf_code"></param>
        /// <returns></returns>
        Task<List<Inv_trf>> Inv_trf_SelectCode(string trf_code);

        /// <summary>
        /// 根据编码查询仓库调拨详情信息
        /// </summary>
        /// <param name="trf_code"></param>
        /// <returns></returns>
        Task<List<Inv_trfproddtl>> Inv_trf_SelectDetail(string trf_code);


        /// <summary>
        /// 新增仓库调拨
        /// </summary>
        /// <returns></returns>
        Task<int> Inv_trf_Insert(Inv_TrfAddDto inv_TrfAddDto);

        /// <summary>
        /// 根据单据编号查询库存调拨单id信息,来添加详细信息
        /// </summary>
        /// <param name="otgwr_code"></param>
        /// <returns></returns>
        Task<int> inv_tfr_id(string trf_code);


        /// <summary>
        /// 添加详情表
        /// </summary>
        /// <param name="inv_trfproddtl"></param>
        /// <returns></returns>
        Task<int> Inv_trf_Selecttrfproddtl(List<Inv_TrftrfproddtlAddDto>  inv_TrftrfproddtlAddDto);


        /// <summary>
        /// 修改审核状态
        /// </summary>
        /// <param name="othwr_code"></param>
        /// <param name="Othwr_audit_by"></param>
        /// <param name="Othwr_audit_time"></param>
        /// <param name="othwr_audit_statua"></param>
        /// <param name="othwr_audit_opinion"></param>
        /// <returns></returns>
        Task<int> Inv_Trf_examineUpdate(Inv_Trf_AuditUpdadteaDto inv_Trf_AuditUpdadteaDto);


        /// <summary>
        /// 删除仓库调拨单
        /// </summary>
        /// <param name="othwr_id"></param>
        /// <returns></returns>
        Task<int> Inv_Trf_delete(int Trf_id);


        /// <summary>
        /// 修改库存调拨单和同一时间执行添加修改库存调拨单详情
        /// </summary>
        /// <param name="inv_Othwr"></param>
        /// <returns></returns>
        Task<int> Inv_othwr_Update(Inv_TrfUpdateMerage   inv_TrfUpdateMerage);


        /// <summary>
        /// 其他入库单入库查询调拨单
        /// </summary>
        /// <returns></returns>
        List<Inv_trf> Inv_Select_MainSelect(string code, int currentPage, int pageSize);


        /// <summary>
        /// 其他入库单入库查询调拨单
        /// </summary>
        /// <returns></returns>
        Task<int> Inv_Select_MainSelect_Count(string code);

        /// <summary>
        /// 回调库存调拨单的数量--其他入库单审核入库之后,减少调拨单的数量
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        //Task<int> Inv_Trf_update_numderl(List<Inv_TrfupdateNumderDto>  inv_TrfupdateNumderDto);


        /// <summary>
        /// 查询调拨单--出库单
        /// </summary>
        /// <param name="code"></param>
        /// <param name="currentPage"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        List<Inv_trf> Inv_Select_othoutordSelect(string code, int currentPage, int pageSize);

        /// <summary>
        /// 其他出库单入库查询调拨单
        /// </summary>
        /// <returns></returns>
        Task<int> Inv_Select_othoutordSelect_Count(string code);


        /// <summary>
        /// 根据其他出库单查询的Id,查询出来关联单号,去修改调拨单的字段状态
        /// </summary>
        /// <param name="othoutord_id"></param>
        /// <returns></returns>
        Task<int> Inv_Trf_update_trf_ckpd(int othoutord_id);


        /// <summary>
        /// 入库完善审核后,修改调拨单的待入库数量
        /// </summary>
        /// <param name="inv_Othwrproddtls"></param>
        /// <returns></returns>
        Task<int> Inv_Trf_update_Pending_numder(List<Inv_Trf_update_Pending_numderUpdateDto> Inv_Trf_update_Pending_numderUpdateDto);
    }
}
